﻿using System;
using System.Collections;

namespace CodepageMaintain
{
	partial class AutoCastCollection<T>
	{
		partial class SafeAutoCastCollection
		{
			partial class SafeAutoCastEnumerator : AutoCastEnumerator
			{
				#region Конструктор

				public SafeAutoCastEnumerator(IEnumerator enumerator)
					: base(enumerator)
				{
				}

				#endregion

				#region Перегруженное свойство

				public override T Current
				{
					get
					{
						if (_enumerator.Current is T)
						{
							return (T)_enumerator.Current;
						}
						return default(T);
					}
				}

				#endregion
			}
		}
	}
}